// 充放电策略选项
export const getChargeTypeOptions = (intl: any) => [
  {
    label: intl.formatMessage({
      id: 'strategyAction.chargeDischargeStrategy.noChargeDischarge',
    }),
    value: '不充不放',
  },
  {
    label: intl.formatMessage({
      id: 'strategyAction.chargeDischargeStrategy.onlyDischarge',
    }),
    value: '只放不充',
  },
  {
    label: intl.formatMessage({
      id: 'strategyAction.chargeDischargeStrategy.onlyCharge',
    }),
    value: '只充不放',
  },
];

// 时段类型选项
export const getTimeTypeOptions = (intl: any) => [
  {
    label: intl.formatMessage({ id: 'strategyAction.electricityPrices.highPeak' }),
    value: '尖',
  },
  {
    label: intl.formatMessage({ id: 'strategyAction.electricityPrices.peak' }),
    value: '峰',
  },
  {
    label: intl.formatMessage({ id: 'strategyAction.electricityPrices.midPeak' }),
    value: '平',
  },
  {
    label: intl.formatMessage({ id: 'strategyAction.electricityPrices.offPeak' }),
    value: '谷',
  },
];

// 执行模式选项
export const getExecutionModeOptions = (intl: any) => [
  {
    label: intl.formatMessage({ id: 'strategyAction.settings.byDate' }),
    value: 'date',
  },
  {
    label: intl.formatMessage({ id: 'strategyAction.settings.byWeek' }),
    value: 'week',
  },
];

// 月份标签数据
export const getMonthTagsData = (intl: any) => [
  intl.formatMessage({ id: 'strategyAction.months.jan' }),
  intl.formatMessage({ id: 'strategyAction.months.feb' }),
  intl.formatMessage({ id: 'strategyAction.months.mar' }),
  intl.formatMessage({ id: 'strategyAction.months.apr' }),
  intl.formatMessage({ id: 'strategyAction.months.may' }),
  intl.formatMessage({ id: 'strategyAction.months.jun' }),
  intl.formatMessage({ id: 'strategyAction.months.jul' }),
  intl.formatMessage({ id: 'strategyAction.months.aug' }),
  intl.formatMessage({ id: 'strategyAction.months.sep' }),
  intl.formatMessage({ id: 'strategyAction.months.oct' }),
  intl.formatMessage({ id: 'strategyAction.months.nov' }),
  intl.formatMessage({ id: 'strategyAction.months.dec' }),
];

// 星期标签数据
export const getWeekTagsData = (intl: any) => [
  intl.formatMessage({ id: 'strategyAction.days.sun' }),
  intl.formatMessage({ id: 'strategyAction.days.mon' }),
  intl.formatMessage({ id: 'strategyAction.days.tue' }),
  intl.formatMessage({ id: 'strategyAction.days.wed' }),
  intl.formatMessage({ id: 'strategyAction.days.thu' }),
  intl.formatMessage({ id: 'strategyAction.days.fri' }),
  intl.formatMessage({ id: 'strategyAction.days.sat' }),
];

// 策略名称校验规则
export const getStrategyNameRules = (intl: any) => [
  {
    required: true,
    message: intl.formatMessage({
      id: 'strategyAction.error.strategyNameCannotBeEmpty',
    }),
  },
  {
    min: 2,
    message: intl.formatMessage({
      id: 'strategyAction.timeSettings.strategyNameMustBeAtLeast2Characters',
    }),
  },
  {
    max: 50,
    message: intl.formatMessage({
      id: 'strategyAction.timeSettings.strategyNameMustBeLessThan50Characters',
    }),
  },
  {
    pattern: /^[\u4e00-\u9fa5a-zA-Z0-9_-]+$/,
    message: intl.formatMessage({
      id: 'strategyAction.timeSettings.strategyNameCanOnlyContainChineseEnglishNumbersUnderscoresAndHyphens',
    }),
  },
];
